﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace DynamicAgent
{
    public class DefaultAopInterceptor : IAopInterceptor
    {
        public void After(MethodInfo abstraceMethod, MethodInfo implementMethod, Exception? ex)
        {
            Console.WriteLine("开始AOP，准备一些数据和异步方法需要的配置或者是自愿");
        }

        public  ValueTask AfterAsync(MethodInfo abstraceMethod, MethodInfo implementMethod, Exception? ex)
        {
            return ValueTask.CompletedTask;
        }

        public void Before(MethodInfo abstraceMethod, MethodInfo implementMethod)
        {
            Console.WriteLine("结束AOP，处理一些资源回收等事务");
        }

        public ValueTask BeforeAsync(MethodInfo abstraceMethod, MethodInfo implementMethod)
        {
            return ValueTask.CompletedTask;
        }
    }
}
